4 import java.awt.event.ActionEvent;
5 import java.awt.event.ActionListener;
6 import java.rmi.Naming;
7 import java.rmi.RemoteException;
9 import javax.swing.GroupLayout;
10 import javax.swing.GroupLayout.Alignment;
11 import javax.swing.JButton;
12 import javax.swing.JFrame;
13 import javax.swing.JPanel;
14 import javax.swing.border.EmptyBorder;
16 import common.HouseInterface;
18 import configuration.___IntNames;
21 public class OffersRelatedOwnerGUI extends JFrame {
26 private static final long serialVersionUID = 1L;
27 private JPanel contentPane;
32 public OffersRelatedOwnerGUI(Owner o) {
33 this.getContentPane().setLayout(null);
35 setBounds(100, 100, 450, 562);
36 contentPane = new JPanel();
37 contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
38 setContentPane(contentPane);
40 JButton btnCreateOffers = new JButton("Create Offers");
41 btnCreateOffers.addActionListener(new ActionListener() {
42 public void actionPerformed(ActionEvent arg0) {
43 HouseInterface houseM=null;
45 houseM = (HouseInterface) Naming
46 .lookup(___IntNames.HouseManager);
47 } catch (Exception e1) {
48 System.out.println("Error accessing remote authentication: "
53 a = new AddOffersGUI(houseM.getHouses(owner, null, null, 0, 0, 0, 0, 0));
54 } catch (RemoteException e) {
55 // TODO Auto-generated catch block
62 JButton btnModifyOffers = new JButton("Modify Offers");
63 btnModifyOffers.addActionListener(new ActionListener() {
64 public void actionPerformed(ActionEvent e) {
66 Frame a = new ModifyOfferGUI(owner);
72 JButton btnDeleteOffers = new JButton("Delete Offers");
73 btnDeleteOffers.addActionListener(new ActionListener() {
74 public void actionPerformed(ActionEvent e) {
75 Frame a = new DeleteOfferGUI(owner);
79 GroupLayout gl_contentPane = new GroupLayout(contentPane);
80 gl_contentPane.setHorizontalGroup(
81 gl_contentPane.createParallelGroup(Alignment.LEADING)
82 .addGroup(gl_contentPane.createSequentialGroup()
84 .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING)
85 .addComponent(btnDeleteOffers, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 1125, Short.MAX_VALUE)
86 .addComponent(btnModifyOffers, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 1125, Short.MAX_VALUE)
87 .addComponent(btnCreateOffers, GroupLayout.DEFAULT_SIZE, 1125, Short.MAX_VALUE))
90 gl_contentPane.setVerticalGroup(
91 gl_contentPane.createParallelGroup(Alignment.LEADING)
92 .addGroup(gl_contentPane.createSequentialGroup()
94 .addComponent(btnCreateOffers, GroupLayout.PREFERRED_SIZE, 58, GroupLayout.PREFERRED_SIZE)
96 .addComponent(btnModifyOffers, GroupLayout.PREFERRED_SIZE, 57, GroupLayout.PREFERRED_SIZE)
98 .addComponent(btnDeleteOffers, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE)
99 .addContainerGap(394, Short.MAX_VALUE))
101 contentPane.setLayout(gl_contentPane);